<div class="sales index">
    <h2 class="left"><?php echo $html->image('iconos/sales.png');__('Ventas'); ?></h2>
    <div class="actions specific">
        <ul>
            <li><?php echo $this->Html->link(__('Nueva Venta', true), array('controller' => 'sales', 'action' => 'add')); ?> </li>
        </ul>
    </div>
    <table cellpadding="0" cellspacing="0">
        <tr>
<!--            <th><?php echo $this->Paginator->sort('Id', 'id'); ?></th>-->
            <th><?php echo $this->Paginator->sort('Fecha de Venta', 'sale_date'); ?></th>
            <th><?php echo $this->Paginator->sort('Total', 'total'); ?></th>
            <th class="actions"><?php __('Opciones'); ?></th>
        </tr>
        <?php
        $i = 0;
        foreach ($sales as $sale):
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
            <tr<?php echo $class; ?>>
    <!--                <td><?php echo $sale['Sale']['id']; ?>&nbsp;</td>-->
                <td><?php
        $fecha = date('d/m/Y', strtotime($sale['Sale']['sale_date']));
        echo $fecha;
            ?>&nbsp;</td>
                <td><?php echo '$'.$sale['Sale']['total']; ?>&nbsp;</td>
                <td class="actions">
                    <?php echo $this->Html->link(__('Ver Detalle', true), array('action' => 'view', $sale['Sale']['id'])); ?>
                    <?php echo $this->Html->link(__('Editar', true), array('action' => 'edit', $sale['Sale']['id'])); ?>
                    <?php echo $this->Html->link(__('Eliminar', true), array('action' => 'delete', $sale['Sale']['id']), null, sprintf(__('Esta seguro que desea eliminar la venta # %s?', true), date('d/m/Y', strtotime($sale['Sale']['sale_date'])))); ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
    <p>
        <?php
        echo $this->Paginator->counter(array(
            'format' => __('Página %page% de %pages%, mostrando %current% registros de %count% en total, a partir del registro %start%, terminando en el %end%', true)
        ));
        ?>	</p>

    <div class="paging">
        <?php echo $this->Paginator->prev('<< ' . __('anterior', true), array(), null, array('class' => 'disabled')); ?>
        | 	<?php echo $this->Paginator->numbers(); ?>
        |
        <?php echo $this->Paginator->next(__('siguiente', true) . ' >>', array(), null, array('class' => 'disabled')); ?>
    </div>
</div>